package com.flightgame.controllers;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.flightgame.tools.Utils;

@Controller
@RequestMapping("/")
public class IndexController {
	@Autowired
	private SessionFactory sessionFactory;
	
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String launch(HttpServletRequest request,HttpServletResponse response) throws IOException{
		
		Utils utils = new Utils();
		
		System.out.println(utils.getFileContent("flightgame.properties"));
		return "redirect:/app/index";
	}
	@RequestMapping(value = "/index", method = RequestMethod.GET)
	public String index(HttpServletRequest request,HttpServletResponse response) throws IOException{
		return "redirect:/googlemap.html";

	}
	
}